﻿using UnityEngine;
using System.Collections;
using Dict.DataModel;
using ProtoBuf.Message;

namespace Room
{
    public class RCUIFish : RCUIBase
    {
        protected TableFieldResource fish;
        protected TableFieldResourcePos fishPos;
        
        public RCUIFish(RoomCharactor owner)
            : base(owner)
        {
            this.owner = owner;
            type = UIType.Fish;
        }

        public virtual void Init(TableFieldResource fish, TableFieldResourcePos fishPos)
        {
            this.fishPos = fishPos;
            this.fish = fish;

            InitButton(() =>
            {
                var room = RoomManager.currentRoom as RoomField;

                
                if (room != null)
                {
                    var netManager = room.netManager as RoomNetField;
                    netManager.SendGetFieldRes(fish.id, fishPos.posId);
                }
            });
            SetButtonSprite("UI_yewai_biaoshi_diaoyu");
        }

        public override void Click()
        {
            OnClick();
        }

        protected override void OnClick()
        {

        }

    }
}
